home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir36
/
sw_46.zip
/
SW-46.DOC
< prev
next >
Wrap
Text File
|
1993-11-08
|
62KB
|
1,270 lines
╔═══════════════════════════════════╗
║ ║▒▒
║ SCREEN WIZARD ║▒▒
║ Batch File Enhancement ║▒▒
║ Version 4.6 ║▒▒
║ ║▒▒
╚═══════════════════════════════════╝▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
November 8, 1993
TABLE OF CONTENTS
1.0 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Screen Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
DI.EXE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Notes on DOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.0 WINDOW APPEARANCE . . . . . . . . . . . . . . . . . . . . . . . . . 3
/F# Foreground Color /B# Background Color . . . . . . . . . . . 3
Color Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
/F#,# Border Background Color . . . . . . . . . . . . . . . . . . . 3
/L# Window Border (Lines) . . . . . . . . . . . . . . . . . . . . . 3
/S# Shadows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
/3D# 3-D Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
/W Wide Edge . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
/2 Double Spacing /0 No Margin . . . . . . . . . . . . . . . . 4
/R# Row /C# Column . . . . . . . . . . . . . . . . . . . . . . . 4
/H# Here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
/D Draw Window . . . . . . . . . . . . . . . . . . . . . . . . . . 5
/Z Zoom Window . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.0 TEXT APPEARANCE . . . . . . . . . . . . . . . . . . . . . . . . . . 5
/T# Text Color /G# Global Text Color . . . . . . . . . . . . . . 5
/E# Enhanced Text Color . . . . . . . . . . . . . . . . . . . . . . 5
/M# Border Message . . . . . . . . . . . . . . . . . . . . . . . . 6
/J# Justify . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.0 SCREEN APPEARANCE . . . . . . . . . . . . . . . . . . . . . . . . . 6
/K# Klear Screen (with optional Fill Character) . . . . . . . . . . 6
/K# Klear Screen, set Foreground Color . . . . . . . . . . . . . . 6
/K# Klear Screen (with optional Fill String) . . . . . . . . . . . 6
/O# Outside Edge (Screen Border) . . . . . . . . . . . . . . . . . 7
/X# Xtra Lines . . . . . . . . . . . . . . . . . . . . . . . . . . 7
/@# Set Cursor . . . . . . . . . . . . . . . . . . . . . . . . . . 7
/@- Hide Cursor . . . . . . . . . . . . . . . . . . . . . . . . . . 7
/D# Screen Saver Delay . . . . . . . . . . . . . . . . . . . . . . 7
5.0 OTHER SWITCHES . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
/P# Pause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
/Q Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
/Q Function Keys . . . . . . . . . . . . . . . . . . . . . . . . . 8
/Q Special Characters, ~ ` ^ * . . . . . . . . . . . . . . . . . . 8
/I# User Input . . . . . . . . . . . . . . . . . . . . . . . . . . 9
/I#var User Input, Custom Variable Name . . . . . . . . . . . . . . 9
/I# User Input, Multiple strings . . . . . . . . . . . . . . . . . 10
/I#### User Input, Long Strings . . . . . . . . . . . . . . . . . . 10
/I##* User Input, Password Blanking . . . . . . . . . . . . . . . . 10
/N# Input Line Number . . . . . . . . . . . . . . . . . . . . . . . 10
/U Input Uppercase . . . . . . . . . . . . . . . . . . . . . . . . 10
/D Draw Window . . . . . . . . . . . . . . . . . . . . . . . . . . 11
/ch Fill Line . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
/ch/ Window Separator . . . . . . . . . . . . . . . . . . . . . . . 11
i
/A# Alert /A#,# Alert with Frequency, Duration . . . . . . . . . 11
/A##-##[,##] Alert Sweep . . . . . . . . . . . . . . . . . . . . . 12
6.0 DEFAULTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.0 SCREEN DEFINITIONS . . . . . . . . . . . . . . . . . . . . . . . . . 12
8.0 TIPS AND TRICKS . . . . . . . . . . . . . . . . . . . . . . . . . . 15
9.0 SHAREWARE INFORMATION . . . . . . . . . . . . . . . . . . . . . . . 16
New Security Version . . . . . . . . . . . . . . . . . . . . . . . . 16
*** BONUS PROGRAMS! *** . . . . . . . . . . . . . . . . . . . . . . 17
**** Bonus CD from JCS Marketing **** . . . . . . . . . . . . . . . 17
Screen Wizard History . . . . . . . . . . . . . . . . . . . . . . . 18
ii
Screen Wizard 4.6
(c) 1993 - Warren Small
1.0 INTRODUCTION
─────────────────────────────────────────────────────────────────────────────
The batch file language for the IBM PC could be described as useful but
not much else. It is lacking a great deal in terms of flexibility. These 2
utilities, Screen Wizard and DI.EXE, attempt to make batch files much more
powerful and at the same time make them nice to look at.
Screen Wizard grew out of my hatred for the ECHO statement. Any time
that I needed to say something to the user, ECHO was the only way. It was
slow and difficult to make look halfway decent. And if I wanted color, there
was ANSI.SYS...
DI.EXE was introduced with SW 4.1 as a response to users who have been
utilizing SW as an install tool for software distribution. DI allows interro-
gation of the disk drives to determine if they are ready for whatever use you
had in mind. This way you can avoid hardware errors which can pop up in the
middle of your nice SW screens. See DI-14.DOC for the details on using DI.
Screen Wizard will display up to 50 lines of text in a window using
either its command line format or an external 'Screen Definition' file. With
either method, the color of each line can be defined separately or as a
group. Also, the colors for the window, its border, the screen background and
its border can be specified. Five different window borders are possible and
the screen background can be filled with characters or complete strings.
Screen Wizard also provides functions for retrieving input from the
user, either single keystrokes or strings, controlling batch file execution
through branching and alerting the user with various sounds or even simple
tunes.
Command Line Syntax:
SW [options] "text1" [options] ["text2"] [options] ["text3"] ...
External File Syntax:
SW @filename [label]
The biggest advantage to using the external file approach is that more
than one window can be displayed with only one call to SW! This can be a
tremendous speed advantage if the batch file is being run from a floppy disk.
The screen definition can also be written into the batch file that utilizes
it so that disk space is used optimally. The optional label shown above is
used to mark different definitions within the same file. The demo batch file,
SW46DEMO.BAT, contains many examples of both methods. See page 12 for more
information.
On the next page is a list of the various switches along with a short
description of what each does. This list appears on the screen when SW is
called without parameters.
Page 1
Screen Wizard 4.6
(c) 1993 - Warren Small
Options
Window: /f# Foregnd (0-15) /b# Backgnd (0-7) /l# Border (0-5) /w Wide Edge
/s# Shadow (1-4) /3D# 3-D Frame /2 Double Spacing /0 No Margin
/r# Row (1-25) /c# Col (1-80) /h# here + # /z Zoom /d Draw
Text: /t#|g# Text (0-15) /e# Enhanced Text /m# Border Msg /j# Justify
Screen: /k#[ ] Clear screen (0-7) [char] /o# Outside edge
/@# Set Cursor /d# Saver Delay (0-30)
Other: /p#[-] Pause /a#[,#] Alert (0-9) /q... Query /char[/] Fill Line
/i#[[*]var] User Input /n# Input Line /u Uppercase /x# Xtra Lines
Switches can be in almost any order, upper or lower case (except /q and
/i, see page 8), and a space is required between each.
While developing batch files using SW, you should be aware of a special
EL code returned when SW encounters an internal error. This can occur when SW
can't find a screen definition file, the label within the file, a parameter
error, or there isn't enough memory to display the window(s). SW returns EL
127 in these cases. You should code your batch file to check for and handle
this situation.
Notes on DOS
* There is a limit to the length of a command line whether it is typed
directly from the DOS prompt or inside a batch file. This limit is 128
characters. Anything past that point will be ignored.
* The Query feature described on page 8 makes use of Errorlevel codes to
allow the batch file to determine which key has been pressed. A series
of IF ERRORLEVEL x statements are used to test for the value. You must
test from largest to smallest since the statement will be true if the
value is equal to OR greater than x.
* The User Input feature (page 9) and four DI switches make use of the
DOS Environment. (DOS 3.3 or higher is required for these features)
This is an area in memory containing information stored by your boot up
procedure as well as some programs. You can see this information by
typing SET from the command line. There are three variables commonly
found in the environment. PATH is a list of directories DOS will search
to find a program not in the current directory. You must set this
yourself, usually as part of the AUTOEXEC.BAT file. COMSPEC tells DOS
where to find COMMAND.COM. If it is anywhere but the root directory of
the boot drive, you will have to set it. PROMPT describes what the DOS
prompt will look like. Your DOS manual has more information.
* To check the answers returned by User Input, the IF statement is used.
In your batch file, the variable name must be preceded and followed the
% sign. On page 9 is a quick example. If you wish to check the actual
value use this form:
IF "%ANS%"=="" goto Label
Page 2
Screen Wizard 4.6
(c) 1993 - Warren Small
This will branch to Label if the user entered nothing. Use IF NOT to
reverse the logic of the comparison. Adding NOT to the above example
would branch to Label if ANS had some value.
* To be sure there is room in the environment you can set the size
manually when booting. "SHELL=C:\COMMAND.COM /E:512 /P" in your
CONFIG.SYS file will set the size to 512 bytes. This value can be as
large as 32768.
2.0 WINDOW APPEARANCE
─────────────────────────────────────────────────────────────────────────────
/F# Foreground Color /B# Background Color
Foreground and background colors for the window are set by the /f# and
/b# switches. The color can be selected using the numbers or names.
Valid background colors are limited to 0-7. If your command line gets to
be longer than 128 characters, use the numbers to gain some space. DOS
will ignore anything past the 128th position on the command line.
Color Values
0 or bla = Black 8 or BLA = Grey
1 or blu = Blue 9 or BLU = Bright Blue
2 or gre = Green 10 or GRE = Bright Green
3 or cya = Cyan 11 or CYA = Bright Cyan
4 or red = Red 12 or RED = Bright Red
5 or mag = Magenta 13 or MAG = Bright Magenta
6 or yel = Brown 14 or YEL = Yellow
7 or whi = White 15 or WHI = Bright White
/F#,# Border Background Color
By default, the background color of the window frame is defined by the
/B parameter. If you want the window border to have a different back-
ground color, use the /F switch with two colors. The first defines the
normal foreground color as above and the second, separated by a comma,
will be used as the border background color. Using just a comma followed
by a color will use the default foreground color. The colors can be any
combination of the numbers or names shown above. For example, /FWHI,4
will result in a border that is bright white on red. /F15,gre results in
bright white on green. /F,whi will use the default foreground color YEL
and the background will be white. As above, the only valid colors for
the background are the first 8. NOTE: When using a window separator (p.
11) it will use the foreground and background colors of the window
border.
/L# Window Border (Lines)
Border type is defined by the /l# (line) switch.
/l0 - none /l1 - ┌─ /l2 - ╔═
/l3 - ╒═ /l4 - ╓─ /l5 - █▀
If a character is used instead of a number, it will be used as the
window border. (e.g. /l* or /l▓).
Page 3
Screen Wizard 4.6
(c) 1993 - Warren Small
/S# Shadows
A shadow can be added with the /s# option. If the shadow covers other
characters on the screen they will be darkened, rather than hidden.
/s1 - right, below (default if /s is used alone)
/s2 - left, below
/s3 - right, above
/s4 - left, above.
/3D# 3-D Frame
The window border can be given a 3-D effect with this switch. The effect
is a darkening of one side and top or bottom of the frame. It can be
used in combination with the /S# switch and will default to the same
value if used without a number specified. The # can be 1-4 and refers to
the same area of the frame as the /S values above.
Examples: SW "3-D Test" /s2 /3D Frame is darkened on the same side as /S
SW "3-D Test" /3D4 Top and left side of frame darkened
SW "3-D Test" /s2 /3D3 Frame darkened on side opposite shadow
The D can be omitted as it is only used for clarity. Some experimenta-
tion will be required for the best color combinations.
/W Wide Edge
The /w switch will give your window a wide edge, making it 2 rows taller
and 4 columns wider. Using this option will reduce the maximum string
length by 6 and the maximum number of lines by 2. The /w switch will
have no effect on a window with no border (/l0).
/2 Double Spacing /0 No Margin
The /2 option will add a blank line between each text line passed. The
/0 switch removes the blank space between the border and first and last
lines of text. Combine /0 with the /l0 switch and the resulting window
will be only as large as needed for the text passed.
/R# Row /C# Column
The position of the window can be set using the /r# (row) and /c# (col-
umn) switches. These are referenced to the upper left corner of the
window. If the window is too big to fit, these coordinates will be
adjusted by the program. Thus if you have a line that places a window in
the lower right hand corner and you want to add a shadow, just put a /s
on the end of the line and the window will be positioned properly
without changing the row and column switch values.
If you wish to set the size of the window yourself, a second /r# and /c#
will define the bottom row and right column. If the text passed to SW
will not fit in the window, these settings will be adjusted by SW auto-
matically, adjusting the bottom and right sides first. If you set only
top and bottom or left and right, SW will calculate the proper values
for you.
Page 4
Screen Wizard 4.6
(c) 1993 - Warren Small
A shorthand version of absolute sizing is available. You can now show
the start and end with one switch for the height, /r#### and one for the
width, /c####. The first 2 digits are the start value. /r1020 is equiva-
lent to /r10 /r20, saving 3 characters on the line.
/H# Here
For simpler positioning, /h# (here) will set the row according to the
present cursor position adding # to it if provided. The value can be
plus or minus. Use the /h# switch when you're trying to mix screen
output from another program with an SW window. The window can be easily
placed relative to the other text and will be centered left to right
unless you use the /c# switch.
/D Draw Window
When a Pause, Query or User Input is utilized, the window will "popup"
on the screen and disappear when the pause finishes or the input has
been processed. If you want the window to be left on the screen, specify
the /d switch. This will draw the window instead. See page 7 for more
information on Pause, Query and User Input.
┌───────────────────────────────────────────────────────────────────────────┐
│ NOTE TO PREVIOUS USERS - Since Pause, Query and User Input windows now │
│ disappear when the function is completed, you may wish to change your │
│ batch files by adding the /D switch. │
└───────────────────────────────────────────────────────────────────────────┘
/Z Zoom Window
A special effect for SW is Zoom Window. Sometimes called "exploding" by
other applications, this switch will cause the window to be drawn in
several steps, from small to its final size. The shadow and border are
zoomed as well with the text added when the proper size is reached.
3.0 TEXT APPEARANCE
─────────────────────────────────────────────────────────────────────────────
/T# Text Color /G# Global Text Color
Text color can be controlled with the /t# and /g# switches. Both use the
same color table shown above and both are position sensitive. /g# will
change the text color for all text following the switch. /t# will effect
only the text string immediately after the switch. Multiple /g# switches
could be used to color groups of lines. To make "text" blink, add 128 to
the color # or put a + after the color name. (e.g. red+ = 4 + 128 = 132
= blinking red). The window foreground color can also blink if desired.
/E# Enhanced Text Color
This switch selects the "enhanced" text color. This is the color used
when you want to highlight characters within a line. The location of
this switch is important as it effects only those lines of text that
follow it, like the /G# switch. In fact, you could use the switch to
give each line a different highlight color.
Marking characters to be highlighted in a line can be accomplished in
one of two ways. The Query example on page 8 shows the use of the ~
Page 5
Screen Wizard 4.6
(c) 1993 - Warren Small
(tilde) character preceding the 'Y' and 'N' and will cause these charac-
ters to appear bright red (/eRED) while the rest of the text is the
default bright white. If the e parameter is omitted, Screen Wizard will
use the color of the current line with the opposite intensity. There is
no limit to the number of characters that can be highlighted on each
line.
If you want to highlight a group of characters on a line, an alternative
to placing a ~ in front of each character is to surround the portion of
the line you want highlighted with curly braces ({ and }). If you need
to use any these characters on a line without highlighting, use a pair
of each. The string "{{Normal Text}}" will appear as "{Normal Text}" in
the window without being highlighted.
/M# Border Message
A /m# preceding a text string marks the string as a Border Message. If
it is the first string in the window, it will appear at the top. If it
appears after the first line of regular text, the message will appear at
the bottom. The # must be l, r or c for left, right and center. Center
is the default if /m is used alone. The message color is defined the
same way as all other text with /t#, /g#, and /e#.
/J# Justify
Text can be justified (aligned) to the left or right as well as the
default centering. This switch works on all strings following its posi-
tion, just like /g#. /jl will align text left and /jr will line up the
text to the right. /jc would restore the default.
4.0 SCREEN APPEARANCE
─────────────────────────────────────────────────────────────────────────────
/K# Klear Screen (with optional Fill Character)
The /k# switch will clear the screen using the color # (0-7) and places
the cursor at the upper left corner. A single character can be added
after the # to give some texture to the screen. (e.g. /k4─ or /kred─)
This can make the shadow effect more interesting.
/K# Klear Screen, set Foreground Color
A second /k# switch on the same line can be used to set the screen fore-
ground color (0-15). SW /kblu /kWHI sets the screen color to bright
white on blue. This will NOT affect the current DOS screen color. The
default screen foreground value is 7 or whi.
/K# Klear Screen (with optional Fill String)
Instead of a simple fill character for the background, a string could be
used in the form /k#string. The string can be up to 80 characters long.
Interesting patterns will result depending on the length. Lengths like
2, 4, 5, 8, 10, etc. divide into 80 evenly. Other values result in each
line being offset from the last. Don't limit yourself to just words. Use
some of the special IBM characters in different combinations. The Demo
batch file has some examples. If you want spaces within the string,
either surround the string with quotes or substitute the underscore (_)
for each space. They will be replaced by spaces before being displayed.
Page 6
Screen Wizard 4.6
(c) 1993 - Warren Small
/O# Outside Edge (Screen Border)
The /o# switch will set the screen border color. All color values are
valid. Using the switch without a color will reset the border to normal.
This switch could be used alone to set or reset the border. SW /ored
will set the screen border to red. Some programs ignore the border
color, others reset it and still others set one of their own. You will
have to experiment on your own is you wish to set a special border color
for a program.
/X# Xtra Lines
SW is EGA 43 and VGA 28/50 line aware, i.e. if the screen is already in
one of those modes, SW will be able to utilize the entire screen. This
switch allows SW to setup 28, 43 and 50 line displays by using /X28,
/X43 and /X50 respectively. /X25 will return to the normal 25 line mode.
The maximum text lines displayed in a box is increased to 23 for the 28
line mode, 38 in the 43 line mode and 45 in the 50 line mode. 5 more
lines can be displayed if the window uses /L0 /0 for parameters.
/@# Set Cursor
If you wish to move the cursor to a particular place on the screen, this
switch will accomplish it. The number which follows /@ can be a row or a
row and col. /@15 will place the cursor on row 15 col 1 and /@234 will
set it on row 2 col 34. The next text output to the screen will begin at
this point. It is important to note that setting the column to something
other than 1 will affect only the first line put on the screen. The rest
will start at the left margin. This switch does NOT affect SW's output.
A number greater than the current number of screen rows will cause the
cursor to be placed on the last line for that mode. A column number
greater than 80 will be converted to 1.
/@- Hide Cursor
SW can hide the cursor after it has finished processing with this
switch. You can make the cursor reappear with any SW command which means
that you need to include this switch on each command line if you want
the cursor to remain hidden. Only one instance of the switch is neces-
sary in a screen definition.
/D# Screen Saver Delay
SW has a simple screen saver to protect your monitor. The saver is used
with /Q and /I (see below). The delay defaults to 5 minutes but can be
altered with this switch. The value can range from 1 to 30 minutes or
can be set to zero which will disable the feature. In screen defini-
tions, the delay value is global, i.e. any /D# used within the defini-
tion is in effect for all the windows defined in it.
5.0 OTHER SWITCHES
─────────────────────────────────────────────────────────────────────────────
/P# Pause
The /p# switch will pause for # 10ths of a second before proceeding. If
# = 0 or is missing the program will wait for the user to press a key.
If you combine Query and Pause, the pause will occur after the query
unless the query specifies a default (See below). Adding a - after the
Page 7
Screen Wizard 4.6
(c) 1993 - Warren Small
number will allow the user to interrupt the timer. e.g. /p50- will pause
for 5 seconds or less if the user presses a key. Maximum value for pause
is 300 or 30 seconds.
/Q Query (Controlled Branching)
The Query switch (/q...) allows user input of single characters. The
selected key sets the DOS Errorlevel allowing conditional branches in
your batch file.
Example: sw /eRED "Continue?" "~Yes ~No" /qyn
if errorlevel 2 goto exit
if errorlevel 1 goto next
This will wait for the user to press the 'y' or 'n' key rejecting all
other keystrokes with a 'beep'. If 'n' is pressed, Errorlevel 2 will be
set and the batch file will branch to the label ":exit". 'y' will cause
a branch to ":next".
/Q Function Keys
The Query can also look for function keys, if desired. They can be
included in the string with other characters in the form "/qabc[F1]".
Pressing the F1 key, in this case, will return EL 4. F1 through F10 can
be used with F10 being represented by [F0]. See the section on Screen
Definitions beginning on page 12 for a special application of F1.
/Q Special Characters, ~ ` ^ *
If the ~ (tilde) character immediately follows the /q, the ESC key is
also available and will set Errorlevel 0 if pressed. Up to 70 characters
can be designated as option keys. If you wish to use the space bar or
the piping (|) and redirection (< or >) characters, enclose all the
characters in quotes. (e.g. /q"abc "). Query is not case-sensitive.
The ` or ^ character can be used to indicate a default choice for the
Query. This choice is available to avoid conflicts with NDOS/4DOS. The ^
symbol can also cause conflicts as the "command separator". However,
this definition can be changed in NDOS/4DOS.
Example: sw /eRED "Continue?" "~Yes ~No" /q^yn
This makes a 'Y' the default. SW will return Errorlevel 1 if ENTER is
pressed. Also, by combining a pause with a default choice, SW will
return the default if no key is pressed before the pause time elapses.
An asterisk (*) used in the Query string acts like a wild card choice.
SW will return an Errorlevel corresponding to its position in the
string.
Example: sw /eRED "Press ~Y to Continue" "Any other key to abort" /qy*
'Y' returns Errorlevel 1 and all other keys return 2. ESC and/or a
default response could be combined with the wildcard option as well.
Page 8
Screen Wizard 4.6
(c) 1993 - Warren Small
Pressing ENTER would then return the default choice as would a Pause
timeout.
Users who wish SW to flush the keyboard buffer prior to checking for
Queries can use an uppercase /Q switch rather than a /q. In both cases,
the result of the query is the same.
/I# User Input (Requires DOS 3.3 or higher)
The /i# switch will add an edit line to the window which will accept
User Input. The # defines the length of the line. This feature can be
used to ask for directory names, file names, drive letters or other
information which can then be used by the batch file. SW will put the
answer in the batch file's environment with the label ANS. DOS 3.3 or
higher is needed for this feature. You can then use the ANS variable in
your batch file. A Pause used with this feature will occur after the
input.
Example: sw "Which Directory?" /i40
if exist %ans%\nul cd %ans%
This does has some limitations since it is difficult to check the
validity of the answer from a batch file.
┌───────────────────────────────────────────────────────────────────────────┐
│ NOTE TO SW 3.8 USERS: If you have used the /i# switch in your batch files,│
│ be sure to remove the line "CALL SW-ENV.BAT" since SW 4.x does not create │
│ the batch file in favor of direct manipulation of the environment. │
└───────────────────────────────────────────────────────────────────────────┘
/I#var User Input, Custom Variable Name
Optionally, you can specify your own environment variable name with the
/i# switch. The variable is indicated by a string, up to 8 characters
long, placed after the number. e.g. /i24Dir gives you a 24 character
field and places the answer in the environment variable DIR. (All envi-
ronment variables are shifted to upper case.) This allows you to get
more than one string before processing. Just be sure your environment is
sized properly. Check the SHELL command in your DOS manual.
The string input editing keys include HOME, END, , , BackSpace, DEL,
INSert and Overtype modes and use of the ESCape key for aborting. A
large cursor indicates the Overtype mode and a small cursor signifies
Insert.
IMPORTANT NOTE: SW 4.2a altered the action of ESC by NOT changing the
original value and returning EL 1 to the batch file. This prevents
unnecessary alteration of the environment. If an error occurs when SW
tries to add the result to the environment, an EL 2 will be returned. EL
0 is returned with normal input.
When using the /I switch, SW will check the environment to see if the
variable you are using is already present. If it is, the value will be
used as a default value in the User Input field. A SET command should
Page 9
Screen Wizard 4.6
(c) 1993 - Warren Small
always precede an SW call with the /I switch. If you do NOT want a
default, you have to make sure the variable is not present. 'SET ANS='
preceding the input call will make sure there is no value in the ANS
variable.
Like the /Q switch, /I will flush the keyboard buffer if an uppercase /I
is used rather than /i. The results for both are equivalent.
/I# User Input, Multiple strings
Assuming that you have adequate space in your environment, you can
retrieve more than one string from a user with only one call to SW. This
is only practical for screen definitions since it requires a good deal
of information to set it up and probably would not fit in a 128 charac-
ter command line. Each input defined would need its own variable name
and prompt. The only caveat to this method is that an ESC is not record-
ed except by the last /I to be processed.
/I#### User Input, Long Strings
If you need to get string input that is longer than the maximum field
length of 70 , use the form /I####. The last 2 digits define the field
size and the rest of the number represents the maximum length of the
string. e.g /I8020 defines a 20 character field with a maximum string
length of 80. Additionally, if the default value found in the environ-
ment exceeds the string length, SW will automatically adjust to compen-
sate. However, the string cannot be made any longer. Maximum string
length is 127 characters minus the length of the variable name. Maximum
field length is 70 if it is on a line by itself. The field size will be
adjusted if its length plus the length of text on the same line exceeds
70 or 64 if using wide margins.
/I##* User Input, Password Blanking
For anyone wanting to use SW to get password input, add an asterisk
between the length and the variable name (if used). This prevents the
password from being displayed on the screen by substituting an asterisk
for each character entered, improving security. It is important to note
that since a batch file is being used to check to validity of the entry,
someone could find out what the password is by looking at the file so
you should at least hide the file to make it more difficult to circum-
vent.
/N# Input Line Number
By default, the User Input field is placed on the last line of the box.
By using the /n# switch, the field can be placed on any line. If # is
positive, the field will appear after the string on line #. If # is
negative, the field will appear by itself on line #.
/U Input Uppercase
If you want only uppercase characters in the answer, use the /u switch.
This can be useful when asking for a drive letter and want to put the
results on the screen for verification.
Page 10
Screen Wizard 4.6
(c) 1993 - Warren Small
/D Draw Window
Pause, Query and User Input windows "popup" on the screen, i.e they
disappear after the Pause, Query or Input finish. /D is used if you want
the window to stay on the screen.
/ch Fill Line
This parameter is used to indicate a character which will be used to
fill a text line position in the window. Any character that is not
already used by another switch is valid. This switch could be used for
horizontal separators in the text box using a ─ (ASCII 196) or a ═
(ASCII 205). The area filled is just inside the border of the box. The
switch should be positioned as if it were a string on the command line
or within the Screen Definition. Its color can be specified the same as
a normal text line. See the first Screen Definition on Page 13 for an
example of its use.
/ch/ Window Separator
This switch is similar to Fill Line except that it will fill the line
completely. If a horizontal line drawing character (ASCII 196 or 205) is
used along with borders /l1 through /l4, the line will be connected to
the border. The line will assume the color of the border.
/A# Alert /A#,# Alert with Frequency, Duration
The Alert switch (/a#) can be used to produce the normal IBM beep if #
is 0 or missing. If that's too boring, nine other sounds can be produced
varying from simple tones to more complex sounds using the values below.
Alert Switch Values
1 - Low Freq Tone 5 - Bweep Two
2 - Mid Freq Tone 6 - Bomb
3 - High Freq Tone 7 - Siren
4 - Bweep One 8 - Phasor
9 - Tweeter
The demo batch file gives you a chance to try them all.
The /A switch can also produce any tone that the PC speaker can put out.
Using the form /A##,##, the first number will be the frequency of the
tone (20-20000) and the second is its duration (1-300 tenths of a sec-
ond). Using a screen definition, songs are actually possible using a
series of lines like "_window /a440,1". This produces a 440 hertz tone
for 1 tenth of a second. SW46DEMO.BAT has some short examples. The use
of a screen definition is needed for speed of execution. Trying this
from several command lines in the batch file will result in a less than
smooth output.
For you musicians out there, there is an easier way to create those
little tunes. Notes can be specified with the /A switch as well. Middle
C is designated as C4. A sharp is shown as C4# and a flat as B3b. The
full form of the switch is /AA4,10 which will play an A, 4th octave, for
Page 11
Screen Wizard 4.6
(c) 1993 - Warren Small
1 second. The tunes in SW46DEMO.BAT use this form of /A. The valid range
is from E0 to B9. It should be noted that the IBM speaker has limita-
tions in reproducing high notes and the practical limit is probably
around a G9 or about 12,000 Hz. Your results could vary depending on
your computer type.
/A##-##[,##] Alert Sweep
A quick sweep of tones can be programmed with this form of the /A
switch. This first number is the start frequency. After the hyphen is
the finish frequency. Optionally, the third number can be used to define
the number of steps to be used from the start frequency to the finish
frequency. Each tone is sounded for about 1/18th of a second so 18 steps
will take about 1 second. The default is 10 steps. Any valid frequency
can be used. Note values are not accepted.
Example: sw /a100-1000,15
This will start at 100 Hz and reach 1000 Hz in 15 steps. The start
frequency can be larger than the finish frequency for a reverse sweep.
6.0 DEFAULTS
─────────────────────────────────────────────────────────────────────────────
Yellow double line border on a centered blue window with white single-
spaced text. Text is centered. No Clear Screen, Shadow or Zoom. Enhanced
color will default to the text color with the opposite intensity. Default
environment variable for /I is ANS. Screen Saver Delay default is 5 minutes.
(/fYEL /bblu /gWHI /l2 /jc /ewhi /d5)
Example: sw /kwhi /fblu /bred /gYEL "Line 1" /tWHI "Line 2" "Line 3" /s2
This will display a blue (/fblu) on red (/bred) window with a shadow to
the left and below it (/s2). The screen color will be white (/kwhi). Lines 1
and 3 are bright yellow (/gYEL) and line 2 is bright white (/tWHI). See the
batch file SW46DEMO.BAT for many more examples.
If no text strings are passed, features such as Clear Screen (/k#),
Query (/q...), Pause (/p#), Alert (/a#[,#]), and Outside Edge (/o#) can be
used with no window output. (e.g. sw /p10 will pause for 1 second.)
7.0 SCREEN DEFINITIONS
─────────────────────────────────────────────────────────────────────────────
Screen Definitions, introduced with version 4.0, greatly enhance the
flexibility and power of SW. It simplifies the command line by putting all
the switches and text into a file that SW can read into memory. Multiple
windows can be defined in the file and displayed with one call to SW. Also,
text handling by one window is expanded to 25 single spaced lines, more if
EGA or VGA modes are used (See /X#, page 7).
When you run SW46DEMO.BAT, you can easily see the advantages of using a
screen definition. All switches just described are applicable in a screen
definition, including Query, Pause, and User input. Windows will be displayed
Page 12
Screen Wizard 4.6
(c) 1993 - Warren Small
in the order that they are read from the file. A pause with the third window
causes the pause to take place after the third window is displayed.
In the batch file, the syntax for using a screen definition is:
SW @filename [label1 label2 ...]
The definition can be in a separate file or even within the same batch
file (See note on page 15). If it is in a separate file, the default exten-
sion .SW will be used if none is provided. The optional label is used when
more than one definition is in the file. The default label is 'Display'.
'End_Display' marks the end of the definition.
As shown in the syntax example, more than one label can be specified on
the command line. This allows combinations of screen defs from the same file
with only one call to SW. You can define different backgrounds and combine
them with different windows. You can also use this feature to reuse back-
grounds without having to redefine them for each window. This can reduce the
size of the screen def file as well as speeding up processing since SW is
called only once and the file is opened only once. Please note that, if you
want to combine a screen def that uses the default label 'Display', you will
need to explicitly include that label on the command line.
┌───────────────────────────────────────────────────────────────────────────┐
│ Default Label │ :Display │
│ first window │ _window /kcya┼ /r2 /s /bred /w /0 │
│ text 1 │ Screen Wizard - Expanded Text Handling! │
│ text 2, new color │ /tWHI+ Multiple Windows! │
│ text 3, footer │ /m v 4.6 │
│ 2nd window │ _window /r10 /s /bwhi /gblu /l1 /fred /0 │
│ text 1, new color │ /tBLU Optional Command Line Syntax: │
│ text 2 │ SW @filename [label] │
│ 3rd window │ _window /r16 /s /bwhi /gblu /l1 /fred /0 │
│ text 1, new color │ /tBLU SW 4.x ADDITIONAL FEATURES │
│ text 2, fill line │ /tred /─ │
│ text 3, justify left│ /jl - Define the entire screen with multiple windows│
│ text 4 │ using external text files. │
│ 4th window, pause │ _window /r25 /l0 /0 /p100- │
│ text 1 │ - Press any key for more - │
│ 5th window, pause │ _window /r19 /bwhi /gblu /l0 /jl /0 /p100- │
│ text 1 │ - Text handling can be expanded to 25 single-spaced │
│ text 2 │ lines per window. │
│ . │ . │
│ . │ . │
│ Final label │ :End_Display │
└───────────────────────────────────────────────────────────────────────────┘
Shown above is a breakdown of a portion of one of the screen definitions
that can be found in SW46DEMO.BAT. There are a total of 5 definitions used by
the demonstration, three of which are within the batch file and two are from
external files.
Page 13
Screen Wizard 4.6
(c) 1993 - Warren Small
The _window line contains the switches that describe the window and
screen and have the same form as they would on a command line, preceded by a
slash and separated by a space. The lines that follow will be interpreted as
text until another '_window' or the ':end_display' label is found.
The text switches can appear on the same line preceding the text. The /t
switch is used to change the color of one line of text and is separated from
the text by a space. /g can be used before a text line to change the color of
every line that follows it. /j can be used to change the text alignment and
/m is used to specify a border message. Finally, /e is used to specify the
"enhanced" text color. Multiple switches can precede the text. The text can
be enclosed by quotes if additional spaces before or after are desired. This
example has 4 pauses and defines small windows that fit inside larger ones to
change the text without redrawing the whole window.
If a different label is needed, simply substitute it for 'Display'. The
label can be up to 15 characters. In SW46DEMO.BAT two of the other defini-
tions use the labels 'Snd_Menu' and '4.6'.
Note that when using the /k switch with a fill string in a screen
definition, do not use quotes around the fill string. This is necessary
because of the way the switch is processed when using the screen definition.
As before, if you need spaces within the string, use the underscore (_)
character. It will be replaced with a space.
A Query will have to be the last item in the definition for the return
code to be valid. User Input can occur anywhere but you will have to wait for
the entire definition to be displayed before checking the answer.
Environment variables will be evaluated when included inside a screen
definition. This enables you to create a screen to display the user's answers
or other information without having to resort to the command line mode. If
the variable is not found, the variable name will be displayed in the window
just as it appears in the screen definition. The variable is evaluated when
the window is displayed.
It is possible to "nest" screen definitions. One potential use is to
reuse a portion of one definition and add a new window to it. Here's what a
simple example would look like:
:Display1
:Display2
_window ...
text
:End_Display1
_window ...
text
:End_Display2
The command "SW @file Display1" would show only the first window and "SW
@file Display2" would display both. Any line beginning with a colon (:) is
Page 14
Screen Wizard 4.6
(c) 1993 - Warren Small
ignored by SW. While not as elegant as using multiple labels on the command
line, this technique could save some disk space.
A Screen Definition can contain a special help window that can be
accessed with the F1 key. A Query (page 8) or User Input field (page 9) must
be part of the screen def. The Query does not need to include the F1 key. The
help window is preceded by "_window_help" and is defined the same as a
regular window. This window is displayed only when the F1 key is pressed. It
is a "popup" window which will disappear after pressing any key. The "_win-
dow_help" can appear anywhere in the definition and only one is permitted.
When using _window_help and multiple labels on the command line, keep in
mind that SW considers the entire group of windows from all labels as one
screen definition. Therefore only one help window is permitted in the
combination. Any other help windows will be displayed as regular windows with
only the last one being designated as the help.
┌───────────────────────────────────────────────────────────────────────────┐
│ One final note on Screen Definitions. If you include them in a batch file,│
│ be certain that the flow of the batch file does not go through the screen │
│ def. The DOS batch processor will not have any idea what those lines mean.│
│ If you see a lot of "Bad command or file name" appearing when the batch is│
│ run, check to see if the screen definition has been bypassed with a goto │
│ or check for a goto that directs the batch file to the screen def. │
└───────────────────────────────────────────────────────────────────────────┘
8.0 TIPS AND TRICKS
─────────────────────────────────────────────────────────────────────────────
* Change the contents of a window without redrawing the whole thing. Use
the /l0 and /0 switches to create a window just big enough for the text
and without a border. This way you can overwrite part or all of the
inside of a window and change the text in a flash. The first demo screen
definition above uses this technique.
* Use the ECHO batch file command to create screen definitions "on the
fly". If you use the redirect character > and the redirect with append
>> you can build a screen definition while running the batch file. In
SW46DEMO.BAT, this method is used to create the help screen for DI.EXE.
Here is a portion:
echo :Display > di.hlp
echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
echo SW.EXE - Now with DI!>> di.hlp
echo /mc v 4.2 >> di.hlp
echo _window /jl /s /0 /r9 >> di.hlp
echo /mc Disk Information >> di.hlp
echo.>> di.hlp
di >> di.hlp
echo. >> di.hlp
echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
echo - Press any key to continue - >> di.hlp
echo :End_Display >> di.hlp
Page 15
Screen Wizard 4.6
(c) 1993 - Warren Small
The first line creates the file "di.hlp" and the following lines append
to it. Then you call SW @di.hlp. Please note that, if quotes are used
around any strings, the >> should be placed directly after the end quote
so there won't be a space after it in the file. If there is a space, SW
would display the end quote in the window which is probably not desir-
able. You should also keep in mind when capturing text from another
program, that any text longer than 72 characters will be truncated and
should be less than 20 lines long unless you are using an EGA or VGA
mode (See /X#, page 7). If more lines are found they are ignored. This
way you can show the result of an operation without destroying the look
of the screen.
* Use the Enhanced text color attribute (/e#) to display text in two
colors on the same line. You could make whole words stand out in this
manner.
SW /tRED /eRED+ "{Blinking} Red"
* If you want to display an empty window, set the size with /r#### and
/c####, then pass one space in a string. SW /r814 /c2060 " "
* Use a FOR loop to evaluate errorlevels returned by a Query. Although it
is slower and requires the use of numbered labels, it can shorten a long
series of IF ERRORLEVELs to one line. In the demo batch file, the sound
menu uses a line like the following to select the sound:
for %%e in (1 2 3 4 5 6 7 8 9 10 11 12) do if errorlevel %%e goto beep%%e
9.0 SHAREWARE INFORMATION
─────────────────────────────────────────────────────────────────────────────
These programs are "shareware". You are allowed to use the programs,
free of charge, for a reasonable amount of time. If you find them to be
useful, and continue to utilize them, a registration fee of $15 is required.
This will entitle you to personal notification of future releases and give
your suggestions for enhancements more value. Many of the enhancements listed
in the history are the result of user comments and suggestions.
CompuServe members can register SW through the service by entering the
command "GO SWREG" and following the prompts. Screen Wizard registration ID
is 641.
New Security Version
If you have trouble with people messing with your screen definition
files, Screen Wizard is now available in a version which will read specially
encrypted files. The encryption scheme will not fool the CIA, but it should
keep curious people from playing with your screen definition files.
This new version, called SWE, has all of the features of the regular
program and is completely compatible with it. It will read straight text
files as well as the encypted ones. The program which does the encrypting
(and decrypting for editing) is included with SWE and is very simple to use.
Page 16
Screen Wizard 4.6
(c) 1993 - Warren Small
If you want to receive SWE and the companion encypting program, the cost
is $15. Use the form provided to register either or both.
*** BONUS PROGRAMS! ***
Anyone registering SW 4.6 will receive a disk with the latest version,
plus an additional program, SWV.EXE. This program is a simple text file
viewer that integrates with SW. SW can generate a window and then call SWV to
display the file within that window. This can be indispensable when a batch
file needs to display a large amount of information with only a little work.
SWV includes features like Search, Place Marks, and Zoom to full screen. SWV
can be used as a stand-alone as well and is EGA 43 and VGA 28/50 line aware.
You will also receive SW-DIR.EXE, a pop-up file directory for batch
files. It inherits many of the appearance switches of SW while allowing the
user to pick from the file list and return the name through the environment.
DOS 3.3 or higher is required.
The newest bonus program is SW-DOS.EXE which allows SW to call DOS
commands or even batch files and have the output confined to a window. It can
be used to display the results of file copying, archive extractions and even
a shell to DOS. Now you don't have to sacrifice a nice SW screen just to be
able to see what your batch file is doing.
Finally, you will receive some more examples of what can be done with SW
with a little work and imagination. Thanks to Bill Davis for HIS work and
imagination. There is also an example of how multiple strings can be re-
trieved with a screen definition.
Registered SW 3.x users can upgrade to SW 4.6 for $5. This is a free
upgrade for SW 4.x users. 4.x users who wish to receive SWV, SW-DOS and SW-
DIR can do so by sending $2.50 for postage and handling to the address below.
Please specify disk size. The file SW-46.REG is provided to simplify regis-
tration and ordering. CompuServe Members can register by entering GO SWREG at
the ! prompt and registering ID #641. Just follow the instructions online.
Site licenses can be negotiated. Feel free to give it to friends or
upload the original archive file to other BBS's provided that no fee is
charged for distribution and it is not modified in any way. Note to BBS
Sysops: Please post this archive file as is, with all files included, and
without changing the filename.
**** Bonus CD from JCS Marketing ****
When you register Screen Wizard, you will receive a certificate redeemable
for one issue of the "JCSM Shareware Collection" CD-ROM at half the normal
cost. This disk is a collection of over 2300 shareware programs from
nearly 1000 authors. The disk will cost $9.95 plus shipping and handling
when the certificate accompanies your order. If you are already a
subscriber, the certificate entitles you to receive your next CD at the
reduced rate.
Page 17
Screen Wizard 4.6
(c) 1993 - Warren Small
Screen Wizard Ver. 4.6 - November 8, 1993
Warren Small CIS 71076,407
35 Benjamin Street GEnie W.SMALL
Manchester, NH 03109 Prodigy RSJW31A
Screen Wizard History
3.6 - 12/31/89 First general release.
3.7 - 02/01/90 Increased text lines to 5. Colors can be specified with
3 letter codes (p. 3). Added Here (/h#, p. 5), Double Spacing (/2, p. 4), No
Margin (/0, p. 4), Enhanced text color (/e#, p. 5).
3.8 - 04/22/91 Added 3 border styles (p. 3), 3 shadow positions (p. 4),
Pause Interrupt (/p#-, p. 7), User Input (/i#, p. 9).
4.0 - 10/31/91 User Input changed to modify environment rather than
create SW-ENV.BAT (p. 9). Removed limit on Highlighting (p. 5). Added custom
window border (/l#char, p. 3), Border Message (/m#, p. 6), Justify (/j#, p.
6), Outside Edge color (/o#, p. 7), 9 Alert sounds (/a#, p. 11), Wide window
edge (/w, p. 4), Foreground color for screen (/k# /k#, p. 6), Query wildcard
(p. 8), default (p. 8), and Pause timeout (/q*^ /p#-, p. 8), Window size
control (/r# /r# /c# /c#, p. 4). Screen Definitions introduced (p. 12).
4.1 - 12/1/91 Enhanced User Input (p. 9). Pause, Query and User Input
window changed to popup style. Added Fill String (/k#string, p. 6), Zoom
Window (/z, p. 5), Input Line (/n#, p. 10), Uppercase Input (/u, p. 10), Draw
Window to override popup (/d, p. 5, 11), custom environment variables
(/i#var, p. 9). New utility added to check disks (DI.EXE, see separate docs).
4.2 - 2/2/92 Added Fill Line (/char, p. 11), shorthand window sizing
(/r#### /c####, p. 4), Alert Freq, Duration (/a#,#, p. 11) or Note, Duration
(/aN,#, p. 11), key buffer flush option for /Q (p. 9) and /I (p. 10), default
value for /I by setting environment variable (p. 9), Window appearance
modified slightly for bordered (1-4) and borderless windows. 5 text line
limit removed from command line form of SW. Environment variables are now
evaluated inside screen definitions (p. 14).
4.2a - 2/29/92 Fixed bug in environment variable evaluation in screen
files which caused rest of file to be read improperly. Added another Query
default indicator ^ for compatibility with NDOS (p. 8). User Input enhanced
to allow large string input in small fields (/I####, p. 10).
4.3 - 6/30/92 /x# added for EGA 43 line & VGA 50 line modes (p. 7). SW
now also detect and setup 43 and 50 line modes. Text lines longer than 70
characters are truncated without displaying an error. "Nested" labels
possible in screen defs (p. 14).
4.3a - 9/16/92 Corrected /w /l5 /─ bug. Added multi-input capability
for screen defs (p. 10).
Page 18
Screen Wizard 4.6
(c) 1993 - Warren Small
4.3b - 11/22/92 Fixed /l0 /0 /x43 bug. Added /@# (p. 7) to set cursor
position and /@- to hide it (p. 7).
4.4 - 12/16/92 Added /x28 mode for VGA displays (p. 7). Added use of {}
to highlight groups of characters (p. 5). Allowed /E# to be used for each
line of text (p. 5). Text handling increased for /L0 /0 windows to the
maximum the screen will allow (80 characters by 25, 28, 43 or 50 lines.)
4.4a - 12/29/92 Fixed /I bug which caused input line to appear in the
wrong place.
4.4b - 3/5/93 Help now in external file to shrink EXE and provide a way
for the user to customize it. Added password blanking to /I (p. 10).
4.5 - 6/12/93 Window separator added (/ch/, p. 11). Function keys added
to Query (p. 8). Help window added to screen def (p. 15). Alert Sweep tones
added (p. 12).
4.5a - 7/11/93 3-D frame effect added (/3D#, p. 4). /@ will handle out
of range values without error (p. 7). Default window size added for SWV and
SW-DOS (Registered version only).
4.5b - 8/7/93 Help Window definition can now be used with a User Input
field (p. 15). Screen Saver added for User Input and Query with programmable
delay (/D#, p. 7). Altered the way environment variables are handled (p. 14).
4.5c - 9/18/93 Default extension for screen definitions added (p. 12).
Border background color added (/f#,#, p. 3).
4.5d - 9/30/93 Multiple labels can be specified on the command line
when using a screen definition file (p. 13). Corrected window size when
using highlighting.
4.6 - 11/6/93 Internal Errors now return EL 127(p. 2). New security
version, SWE, uses encrypted screen defs (p. 16).
Page 19